<!-- 分销中心  -->
<template>
  <s-layout class="index-wrap" title="商家入驻" onShareAppMessage>
    <view class="main">
		<view class="block">
			
			<view class="ss-flex justify-end">
				
				<view class="font-1" style="color:#003288" @tap="sheep.$router.go('/pages/commission/merchant/submit-log?type=0')">入驻进度</view>
			</view>
			<view class="list">
				<template v-for="(item,index) in list1" :key="index">
					<view class="list-item  ss-flex justify-center" @tap="jump(item)">
						<image style="width:80rpx;height:80rpx" :src="sheep.$url.cdn(item.img)" ></image>
						<view class="name">{{item.name}}</view>
					</view>
				</template>
				
			</view>
		</view>
	</view>

		<!-- 不是商家的弹框 -->
		<su-popup :show="show" type="center" round="0" :isMaskClick="true" backgroundColor="transparent" @close="close">
			<view class="business-contents">
				<view class="cont">
					<view class="title">{{ state.title }}</view>
					<view class="content">{{ state.content }}</view>
				</view>
				<view class="btn" @tap="sheep.$router.go('/pages/store/index')">{{ state.btnText }}</view>
			</view>
		</su-popup>
  </s-layout>
</template>

<script setup>
  import sheep from '@/sheep';
  import { onShow } from '@dcloudio/uni-app';
  import { computed, reactive, ref } from 'vue';
 

  const state = reactive({
    visible: false,
		title: '温馨提示',
		content: '您还不是商家，入住后后可使用此功能',
		btnText: '去入驻'
  });

	const show = ref(false)
  
  const list1=[
	  {img:'/storage/giveaway/20250314/d01045188fb2b7c842e568abfd65c02c.png',name:'本地生活',link:'/pages/commission/giveaway/live', id: 1},
	  {img:'/storage/giveaway/20250314/568b17cb9162708aa036e9cd1db6eabc.png',name:'电商商城',link:'/pages/commission/giveaway/ebusiness', id: 2},
	  // {img:'/storage/logo/24657e4b73b98fab2834a5c951cd70f.png',name:'鲸囍商户',link:'/pages/commission/giveaway/surperise'},
	  {img:'/storage/default/20250419/55b6ff3fc364fdb2b1d6672ae724c6e2.png',name:'供应链',link:'/pages/commission/giveaway/supply', id: 10},
	  // {img:'/storage/default/20250419/55b6ff3fc364fdb2b1d6672ae724c6e2.png',name:'货源推荐',link:'/pages/distribution/index', id: 4},
  ]

	const userInfo = computed(() => sheep.$store('user').userInfo);


  function jump(item){
		if (item.id == 4) {
			// userInfo.value.cyq_store_id
			console.log(userInfo.value.cyq_store_id, 'userInfo.value.cyq_store_id')
			if (userInfo.value.cyq_store_id) { // 判断是否有超引擎id
				sheep.$router.go(item.link)
			} else {
				show.value = true
			}
		} else {
			sheep.$router.go(item.link)
		}
  }
	const close = () => {
		show.value = false
	}
  onShow(() => {
  });
</script>

<style lang="scss" scoped>
  :deep(.page-main) {
    background-size: 100% 100% !important;
  }
  .main{
	  padding:25rpx;
	  .block{
		  background:#fff;
		  border-radius: 20rpx;
		  padding:33rpx 37rpx;
		  .tip{
		  	  padding:18rpx 24rpx;
		  	  background:#FFF6EA;
		  	  color:#E6A406;
		  	  line-height: 1.5em;
		  }
		  .title{
			font-size: 32rpx; 
			font-weight: bold;
			color: #383838;
		  }
		  .list{
			  display:grid;
			  grid-template-columns: repeat(4, 1fr);
			  &-item{
				  margin-top:40rpx;
				  flex-direction:column
			  }
			  .name{
				  margin-top:16rpx;
				  font-size:28rpx;
			  }
		  }
	  }
  }
	.business-contents {
		width: 650rpx;
		height: 431rpx;
		background-image: url('https://xyh-static-app.oss-cn-hangzhou.aliyuncs.com/storage/default/20250408/839be2dd0fcc846e8a6b2b8f86e1d437.png');
		background-size: 100% 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		.title {
			font-size: 30rpx;
			font-weight: 700;
			color: #171717;
			text-align: center;
		}
		.content {
			font-size: 30rpx;
			font-weight: 400;
			color: #171717;
			text-align: center;
			margin-top: 12rpx;
			margin-bottom: 26rpx;
		}
		.btn {
			width: 480rpx;
			height: 90rpx;
			line-height: 90rpx;
			background: #426DFA;
			border-radius: 100rpx;
			font-size: 30rpx;
			font-weight: 700;
			color: #fff;
			text-align: center;
			box-shadow: 0rpx 25rpx 50rpx 0rpx rgba(74, 116, 254, 0.41);
		}
	}

</style>
